package com.tsinghua.server.base.controller;

import com.tsinghua.server.common.Result;
import com.tsinghua.server.base.entity.DataSampleEntity;
import com.tsinghua.server.base.service.DataSampleService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping(value = "/risk/sample")
@RequiredArgsConstructor
public class DataSampleController {
    @Resource
    DataSampleService dataSampleService;

    @PostMapping("/getList")
    public Result listUsers(@RequestBody DataSampleEntity dataSampleEntity ,
                            @RequestParam(value = "pageSize", required = false, defaultValue = "20") Integer pageSize,
                            @RequestParam(value = "pageNo", required = false, defaultValue = "1") Integer pageNo) {

        return Result.succ(dataSampleService.getList(dataSampleEntity, pageSize, pageNo));
    }
}
